import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:amap_flutter_search/src/entity/poi.dart';

class InputTipResult {
  String? district;
  String? address;
  String? typecode;
  String? uid;
  LatLng? location;
  String? adcode;
  String? name;

  InputTipResult(
      {this.district,
        this.address,
        this.typecode,
        this.uid,
        this.location,
        this.adcode,
        this.name});

  InputTipResult.fromJson(Map<String, dynamic> json) {
    district = json['district'];
    address = json['address'];
    typecode = json['typecode'];
    uid = json['uid'];
    location = NLatLng.from(json['location']);
    adcode = json['adcode'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['district'] = this.district;
    data['address'] = this.address;
    data['typecode'] = this.typecode;
    data['uid'] = this.uid;
    if (this.location != null) {
      data['location'] = this.location!.toJson();
    }
    data['adcode'] = this.adcode;
    data['name'] = this.name;
    return data;
  }
}
